if not SYSPATH then return end
    -----------------------------------------
    --公共聊天界面
    -----------------------------------------
    
    local zOrder    = 1000
    local EditLen   = 26
    local M  	= class("chat",PanelInner)
    local request   = app.gamesUse("request")
    local model     = app.model("common")
    
    function M:ctor(param)
        self._type = param
        self.class.super.ctor(self)
        Effects:addSpriteFrames("Brow")
        self:init()
    end
    
    function M:onEnter()
        self.class.super.onEnter(self)
    end
    
    function M:onExit()
    end
    
    function M:init()
        print(">>>>>加载zhi聊天界面")
        
        local main = cc.CSLoader:createNode("zjh/res/chat.csb")         --调用子游戏层
        self:addChild(main,999)
        Adaptive(main).h()
        local scroll = cc.uiloader:seekNodeByName(main, "scroll")   --表情
        local list = cc.uiloader:seekNodeByName(main, "list")       --文字
        local yuyin = cc.uiloader:seekNodeByName(main, "btn_yuyin")
        local biaoqing = cc.uiloader:seekNodeByName(main, "btn_bq")
        local input = cc.uiloader:seekNodeByName(main, "input")
        local yuyinSed = cc.uiloader:seekNodeByName(yuyin, "img_sed")
        local bqSed = cc.uiloader:seekNodeByName(biaoqing, "img_sed")
        local function callback(obj,e)
            if e == ccui.TouchEventType.ended then
                if obj:getName() == "btn_yuyin" then
                    yuyinSed:setVisible(true)
                    bqSed:setVisible(false)
                    scroll:setVisible(false)
                    list:setVisible(true)
                    list:removeAllItems()
                    for i=1, #CHAT_TXT do  
                        local cel = cc.uiloader:seekNodeByName(main, "btn_cell"):clone()
                        cc.uiloader:seekNodeByName(cel, "txt_desc"):setString(TEXT("chat.normal"..i))
                        cel:setVisible(true)
                        cel:setTag(i)
                        cel:addTouchEventListener(function (obj,e)
                            if e == ccui.TouchEventType.ended then
                                request:onChat(CHAT_TXT[obj:getTag()],"text")
                                game.view.back("common.chat","zjh")
                            end
                        end)
                        list:pushBackCustomItem(cel)                            
                    end
                elseif obj:getName() == "btn_bq" then
                    yuyinSed:setVisible(false)
                    bqSed:setVisible(true)
                    scroll:setVisible(true) 
                    list:setVisible(false)
                    scroll:removeAllChildren()
                    scroll:setInnerContainerSize(cc.size(scroll:getContentSize().width, 130 * 3))
                    local x, y = 105, scroll:getInnerContainerSize().height - 50
                    for i=1, #BROW_NAME do                                           
                        local btn = cc.uiloader:seekNodeByName(main, "btn_close"):clone()
                        btn:loadTextures(BROW_NAME[i] .."0.png",BROW_NAME[i] .."0.png",BROW_NAME[i] .."0.png",1)
                        btn:addTouchEventListener(function(obj,e)
                            request:onChat(i,"brow")
                            game.view.back("common.chat","zjh")
                        end)
                        btn:setTag(i)
                        btn:setPosition(cc.p(x,y))
                        scroll:addChild(btn)
                        x = x + 160 
                        if i % 5 == 0 then
                            x =  105
                            y = y - 130 
                       end                                  
                     end
                elseif obj:getName() == "btn_close" then
                    game.view.back("common.chat","zjh")
                elseif obj:getName() == "btn_send" then 
                    if input:getString() ~= "" then
                        request:onChat(MsgParser:getString(input:getString()),"text")
                        main:removeFromParent()
                    end  
                end
            end
        end
        biaoqing:addTouchEventListener(callback)
        yuyin:addTouchEventListener(callback)
        cc.uiloader:seekNodeByName(main, "btn_close"):addTouchEventListener(callback)
        cc.uiloader:seekNodeByName(main, "btn_send"):addTouchEventListener(callback)
        cc.uiloader:seekNodeByName(main, "input")
        callback(biaoqing,2)
    end 
    
    return M